#pragma once

#include "CListControl.h"
#include "CScrollBase.h"
class UI_API CListBox : public CListControl, private IScrollHost
{
public:
	CListBox();
	CListBox(int_32 iX, int_32 iY, int_32 iWidth, int_32 iHeight);
	~CListBox();

	const COID & GetOID() const;
	void MouseMove(CMouseArgument & args);
	void MouseOut(CMouseArgument & args);
	void MouseClick(CMouseArgument & args);
	void FontFormatChanged();
	void ForeColorChanged();

	void OnPaintBack(IPaint * pPaint, const CRectInt32 & rcClip) const;
	void OnPaint(IPaint * pPaint, const CRectInt32 & rectClip) const;

	void SetVerticalScroll(IImage * pImage, int_32 iWidth, ImageMode eImageMode, ImageTileMode eImageTileMode);

	void RepaintScroll();
	void MinValueChanged(IScroll * pScroll) {}
	void MaxValueChanged(IScroll * pScroll){}
	void ValueChanged(IScroll * pScroll){}
	void ScrollSizeChanged(IScroll * pScroll){}
	void LineValueChanged(IScroll * pScroll){}
	void PageValueChanged(IScroll * pScroll){}
	void ScrollPointChanged(IScroll * pScroll){}
public: // CListControl
	void SelectItem(int iIndex, bool bSelect);
protected:
	void SetHovingIndex(int_32 iHovingIndex);
protected:
	int_32 m_iHovingIndex;

	CScrollBase m_sclVertical;
	CImageState m_imgVertical;
};
